<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>TurtleDB: ca.uqac.dim.turtledb.Table Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">TurtleDB
   
   </div>
   <div id="projectbrief">A mini distributed database system</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Packages</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="#pac-methods">Package Functions</a>  </div>
  <div class="headertitle">
<div class="title">ca.uqac.dim.turtledb.Table Class Reference</div>  </div>
</div><!--header-->
<div class="contents">
<!-- doxytag: class="ca::uqac::dim::turtledb::Table" --><!-- doxytag: inherits="ca::uqac::dim::turtledb::Relation" --><div class="dynheader">
Inheritance diagram for ca.uqac.dim.turtledb.Table:</div>
<div class="dyncontent">
<div class="center"><img src="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table__inherit__graph.png" border="0" usemap="#ca_8uqac_8dim_8turtledb_8_table_inherit__map" alt="Inheritance graph"/></div>
<map name="ca_8uqac_8dim_8turtledb_8_table_inherit__map" id="ca_8uqac_8dim_8turtledb_8_table_inherit__map">
<area shape="rect" id="node2" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_relation.html" title="ca.uqac.dim.turtledb.Relation" alt="" coords="5,5,197,32"/></map>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>
<div class="dynheader">
Collaboration diagram for ca.uqac.dim.turtledb.Table:</div>
<div class="dyncontent">
<div class="center"><img src="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table__coll__graph.png" border="0" usemap="#ca_8uqac_8dim_8turtledb_8_table_coll__map" alt="Collaboration graph"/></div>
<map name="ca_8uqac_8dim_8turtledb_8_table_coll__map" id="ca_8uqac_8dim_8turtledb_8_table_coll__map">
<area shape="rect" id="node2" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_relation.html" title="ca.uqac.dim.turtledb.Relation" alt="" coords="5,85,197,115"/><area shape="rect" id="node4" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_schema.html" title="ca.uqac.dim.turtledb.Schema" alt="" coords="221,85,413,115"/></map>
<center><span class="legend">[<a target="top" href="graph_legend.html">legend</a>]</span></center></div>

<p><a href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table_1_1_table_cache_iterator.html">TableCacheIterator</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table_1_1_table_stream_iterator.html">TableStreamIterator</a></td></tr>
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a19e03b8dfa939e27ced2524f68df362d">Table</a> (<a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_relation.html">Relation</a> r)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a07b9a138dc1d83a847ce9493b8829573">setName</a> (String name)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">String&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#acb4bb7666131acb57ae0663c5ef2a65f">getName</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_schema.html">Schema</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#ad4377b0b6d6bd9b573db9dd3824fd08f">getSchema</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#ac72d81075238b6f6e8406714a12156ff">put</a> (<a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_tuple.html">Tuple</a> t)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a6d4c40243f777b5cb535b5b2435e24c3">putAll</a> (Collection&lt; <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_tuple.html">Tuple</a> &gt; tuples)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a45af187301ba83ec19575c957db219d0">accept</a> (<a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_query_visitor.html">QueryVisitor</a> v)  throws EmptyQueryVisitor.VisitorException   </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a8629afcfbc2c3791cf3f94d9feacd505">copy</a> (<a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_relation.html">Relation</a> r)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a34f929a0250eea5bb1bc7e515840141a">getCardinality</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a092526a7a8d2c0630d295d0bc7f47c9a">contains</a> (<a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_tuple.html">Tuple</a> tup)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a615684670db2aebde7f60439f4dd4176">tupleCount</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">final boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#aa0537277d7f1335610e0e08ca91ca8de">isLeaf</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_relation_stream_iterator.html">RelationStreamIterator</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a8616d5a42e073876c16bdb41bd17baa5">streamIterator</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="interfaceca_1_1uqac_1_1dim_1_1turtledb_1_1_relation_iterator.html">RelationIterator</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a5b3c6b4fb85f117600334e229d4075a0">cacheIterator</a> ()</td></tr>
<tr><td colspan="2"><h2><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a226e2304771b71716a8961a4a0a8446e">setSchema</a> (<a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_schema.html">Schema</a> sch)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Iterator&lt; <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_tuple.html">Tuple</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a19846d1f280e9a8658a751b5b6e23bf6">tupleIterator</a> ()</td></tr>
<tr><td colspan="2"><h2><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">List&lt; <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_tuple.html">Tuple</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a8d7fc7bc7d659babddbee9c10f6d3130">m_tuples</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_schema.html">Schema</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a80c04212069dd7548effe8acbf0a2b9d">m_schema</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#aca90042d676729668163a64a9c075d90">m_cursor</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">String&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a7ad2aa40cdd0507967204075cdeac3ad">m_name</a></td></tr>
<tr><td colspan="2"><h2><a name="pac-methods"></a>
Package Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#abb6eb786dd391170f9b63368bcda747f">Table</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#ae3427ed0a30019eb8b74c9ab979f3c04">Table</a> (String s)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a98634d859b5c4cef0e8214f0fafcc798">Table</a> (<a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_schema.html">Schema</a> sch)</td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>A <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html">Table</a> is a list of tuples. Since the leaves of a relational query tree are always tables, it is the only <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_relation.html">Relation</a> that actually holds data. </p>
<p>Internally, tables are implemented as a <em>sorted</em> linked list of tuples. Sorting is maintained at insertion of each tuple. Consquently, a tuple that is to be modified will be removed, changed, and re-inserted so that the global ordering of tuples is always respected. </p>
<dl class="author"><dt><b>Author:</b></dt><dd>sylvain </dd></dl>

<p>Definition at line <a class="el" href="_table_8java_source.html#l00035">35</a> of file <a class="el" href="_table_8java_source.html">Table.java</a>.</p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="abb6eb786dd391170f9b63368bcda747f"></a><!-- doxytag: member="ca::uqac::dim::turtledb::Table::Table" ref="abb6eb786dd391170f9b63368bcda747f" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#abb6eb786dd391170f9b63368bcda747f">ca.uqac.dim.turtledb.Table.Table</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [package]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Empty constructor. Should only be called from another constructor. </p>

<p>Definition at line <a class="el" href="_table_8java_source.html#l00045">45</a> of file <a class="el" href="_table_8java_source.html">Table.java</a>.</p>

</div>
</div>
<a class="anchor" id="ae3427ed0a30019eb8b74c9ab979f3c04"></a><!-- doxytag: member="ca::uqac::dim::turtledb::Table::Table" ref="ae3427ed0a30019eb8b74c9ab979f3c04" args="(String s)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#abb6eb786dd391170f9b63368bcda747f">ca.uqac.dim.turtledb.Table.Table</a> </td>
          <td>(</td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>s</em></td><td>)</td>
          <td><code> [package]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_table_8java_source.html#l00052">52</a> of file <a class="el" href="_table_8java_source.html">Table.java</a>.</p>

</div>
</div>
<a class="anchor" id="a19e03b8dfa939e27ced2524f68df362d"></a><!-- doxytag: member="ca::uqac::dim::turtledb::Table::Table" ref="a19e03b8dfa939e27ced2524f68df362d" args="(Relation r)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#abb6eb786dd391170f9b63368bcda747f">ca.uqac.dim.turtledb.Table.Table</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_relation.html">Relation</a>&#160;</td>
          <td class="paramname"><em>r</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Constructor by copy </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">r</td><td></td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_table_8java_source.html#l00062">62</a> of file <a class="el" href="_table_8java_source.html">Table.java</a>.</p>

</div>
</div>
<a class="anchor" id="a98634d859b5c4cef0e8214f0fafcc798"></a><!-- doxytag: member="ca::uqac::dim::turtledb::Table::Table" ref="a98634d859b5c4cef0e8214f0fafcc798" args="(Schema sch)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#abb6eb786dd391170f9b63368bcda747f">ca.uqac.dim.turtledb.Table.Table</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_schema.html">Schema</a>&#160;</td>
          <td class="paramname"><em>sch</em></td><td>)</td>
          <td><code> [package]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Creates an empty table with given schema </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">sch</td><td>The table's schema </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_table_8java_source.html#l00086">86</a> of file <a class="el" href="_table_8java_source.html">Table.java</a>.</p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a45af187301ba83ec19575c957db219d0"></a><!-- doxytag: member="ca::uqac::dim::turtledb::Table::accept" ref="a45af187301ba83ec19575c957db219d0" args="(QueryVisitor v)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a45af187301ba83ec19575c957db219d0">ca.uqac.dim.turtledb.Table.accept</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_query_visitor.html">QueryVisitor</a>&#160;</td>
          <td class="paramname"><em>v</em></td><td>)</td>
          <td>  throws EmptyQueryVisitor.VisitorException   <code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Implements <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_relation.html#adb708409ab8c4a428ed102c4ce850ffe">ca.uqac.dim.turtledb.Relation</a>.</p>

<p>Definition at line <a class="el" href="_table_8java_source.html#l00157">157</a> of file <a class="el" href="_table_8java_source.html">Table.java</a>.</p>

</div>
</div>
<a class="anchor" id="a5b3c6b4fb85f117600334e229d4075a0"></a><!-- doxytag: member="ca::uqac::dim::turtledb::Table::cacheIterator" ref="a5b3c6b4fb85f117600334e229d4075a0" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="interfaceca_1_1uqac_1_1dim_1_1turtledb_1_1_relation_iterator.html">RelationIterator</a> <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a5b3c6b4fb85f117600334e229d4075a0">ca.uqac.dim.turtledb.Table.cacheIterator</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns an iterator over tuples of the relation </p>
<dl class="return"><dt><b>Returns:</b></dt><dd></dd></dl>

<p>Implements <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_relation.html#a2ea66dc69ae6dc86627aed815ebd40b6">ca.uqac.dim.turtledb.Relation</a>.</p>

<p>Definition at line <a class="el" href="_table_8java_source.html#l00263">263</a> of file <a class="el" href="_table_8java_source.html">Table.java</a>.</p>

</div>
</div>
<a class="anchor" id="a092526a7a8d2c0630d295d0bc7f47c9a"></a><!-- doxytag: member="ca::uqac::dim::turtledb::Table::contains" ref="a092526a7a8d2c0630d295d0bc7f47c9a" args="(Tuple tup)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">boolean <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a092526a7a8d2c0630d295d0bc7f47c9a">ca.uqac.dim.turtledb.Table.contains</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_tuple.html">Tuple</a>&#160;</td>
          <td class="paramname"><em>tup</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Determines if a relation contains a given tuple. Contrarily to the generic implementation of <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a092526a7a8d2c0630d295d0bc7f47c9a">contains</a>, the method for instances of <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html">Table</a> <em>is</em> efficient, as it simply calls the contains method of the underlying list of tuples. It does not present the side effects (reset of enumeration) that the generic method has. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">tup</td><td>The tuple to look for </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>True if the tuple is present, false otherwise </dd></dl>

<p>Reimplemented from <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_relation.html#a19071d0ee56a8c3e2c5374a355cfec4d">ca.uqac.dim.turtledb.Relation</a>.</p>

<p>Definition at line <a class="el" href="_table_8java_source.html#l00197">197</a> of file <a class="el" href="_table_8java_source.html">Table.java</a>.</p>

</div>
</div>
<a class="anchor" id="a8629afcfbc2c3791cf3f94d9feacd505"></a><!-- doxytag: member="ca::uqac::dim::turtledb::Table::copy" ref="a8629afcfbc2c3791cf3f94d9feacd505" args="(Relation r)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a8629afcfbc2c3791cf3f94d9feacd505">ca.uqac.dim.turtledb.Table.copy</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_relation.html">Relation</a>&#160;</td>
          <td class="paramname"><em>r</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Copies the contents of a relation into the current relation. In particular, invoking <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a8629afcfbc2c3791cf3f94d9feacd505">copy</a> with a query tree triggers the computation of that query and the storing of the resulting tuples into the current relation. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">r</td><td>The relation to copy from </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_table_8java_source.html#l00169">169</a> of file <a class="el" href="_table_8java_source.html">Table.java</a>.</p>

</div>
</div>
<a class="anchor" id="a34f929a0250eea5bb1bc7e515840141a"></a><!-- doxytag: member="ca::uqac::dim::turtledb::Table::getCardinality" ref="a34f929a0250eea5bb1bc7e515840141a" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a34f929a0250eea5bb1bc7e515840141a">ca.uqac.dim.turtledb.Table.getCardinality</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Computes the cardinality of a relation. Except for instances of <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html">Table</a> (which actually contain concrete tuples), calling this method will trigger the evaluation of the query tree and the enumeration of all tuples. It should be used sparingly. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The number of tuples in the relation </dd></dl>

<p>Reimplemented from <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_relation.html#ad9a0a0c06639d3697952669e4c504420">ca.uqac.dim.turtledb.Relation</a>.</p>

<p>Definition at line <a class="el" href="_table_8java_source.html#l00181">181</a> of file <a class="el" href="_table_8java_source.html">Table.java</a>.</p>

</div>
</div>
<a class="anchor" id="acb4bb7666131acb57ae0663c5ef2a65f"></a><!-- doxytag: member="ca::uqac::dim::turtledb::Table::getName" ref="acb4bb7666131acb57ae0663c5ef2a65f" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">String <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#acb4bb7666131acb57ae0663c5ef2a65f">ca.uqac.dim.turtledb.Table.getName</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Gives the table's name </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The table's name </dd></dl>

<p>Definition at line <a class="el" href="_table_8java_source.html#l00096">96</a> of file <a class="el" href="_table_8java_source.html">Table.java</a>.</p>

</div>
</div>
<a class="anchor" id="ad4377b0b6d6bd9b573db9dd3824fd08f"></a><!-- doxytag: member="ca::uqac::dim::turtledb::Table::getSchema" ref="ad4377b0b6d6bd9b573db9dd3824fd08f" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_schema.html">Schema</a> <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#ad4377b0b6d6bd9b573db9dd3824fd08f">ca.uqac.dim.turtledb.Table.getSchema</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the relation's schema </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The schema </dd></dl>

<p>Implements <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_relation.html#a7a7af53642133603e51e04d79f938286">ca.uqac.dim.turtledb.Relation</a>.</p>

<p>Definition at line <a class="el" href="_table_8java_source.html#l00113">113</a> of file <a class="el" href="_table_8java_source.html">Table.java</a>.</p>

</div>
</div>
<a class="anchor" id="aa0537277d7f1335610e0e08ca91ca8de"></a><!-- doxytag: member="ca::uqac::dim::turtledb::Table::isLeaf" ref="aa0537277d7f1335610e0e08ca91ca8de" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">final boolean <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#aa0537277d7f1335610e0e08ca91ca8de">ca.uqac.dim.turtledb.Table.isLeaf</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Determines if a given operator is at the leaf of the query tree. Only instances of <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html">Table</a> and <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_variable_table.html">VariableTable</a> may be leaves. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd></dd></dl>

<p>Reimplemented from <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_relation.html#abeb9200b77b041da59550c75aab6fe22">ca.uqac.dim.turtledb.Relation</a>.</p>

<p>Definition at line <a class="el" href="_table_8java_source.html#l00210">210</a> of file <a class="el" href="_table_8java_source.html">Table.java</a>.</p>

</div>
</div>
<a class="anchor" id="ac72d81075238b6f6e8406714a12156ff"></a><!-- doxytag: member="ca::uqac::dim::turtledb::Table::put" ref="ac72d81075238b6f6e8406714a12156ff" args="(Tuple t)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#ac72d81075238b6f6e8406714a12156ff">ca.uqac.dim.turtledb.Table.put</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_tuple.html">Tuple</a>&#160;</td>
          <td class="paramname"><em>t</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Adds a new tuple to the table. It is assumed that the tuple's degree is equal to the schema's degree. An <em>assertion</em> fails otherwise (but no exception is raised). This also affixes the table's name to each attribute, except if the table's name is the empty string. </p>
<p>The method put also ensures that the tuple is inserted at the correct location to keep the linked list sorted. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">t</td><td>The tuple to add </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_table_8java_source.html#l00130">130</a> of file <a class="el" href="_table_8java_source.html">Table.java</a>.</p>

</div>
</div>
<a class="anchor" id="a6d4c40243f777b5cb535b5b2435e24c3"></a><!-- doxytag: member="ca::uqac::dim::turtledb::Table::putAll" ref="a6d4c40243f777b5cb535b5b2435e24c3" args="(Collection&lt; Tuple &gt; tuples)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a6d4c40243f777b5cb535b5b2435e24c3">ca.uqac.dim.turtledb.Table.putAll</a> </td>
          <td>(</td>
          <td class="paramtype">Collection&lt; <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_tuple.html">Tuple</a> &gt;&#160;</td>
          <td class="paramname"><em>tuples</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Adds a collection of tuples to the table. This is just the repeated application of <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#ac72d81075238b6f6e8406714a12156ff">put</a> to every tuple in the collection. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">tuples</td><td>The tuples to add </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_table_8java_source.html#l00148">148</a> of file <a class="el" href="_table_8java_source.html">Table.java</a>.</p>

</div>
</div>
<a class="anchor" id="a07b9a138dc1d83a847ce9493b8829573"></a><!-- doxytag: member="ca::uqac::dim::turtledb::Table::setName" ref="a07b9a138dc1d83a847ce9493b8829573" args="(String name)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a07b9a138dc1d83a847ce9493b8829573">ca.uqac.dim.turtledb.Table.setName</a> </td>
          <td>(</td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>name</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Sets a name for the table. It is preferred to create a table with a name directly through the constructor, as using this method implies changing the table's name into every attribute of every tuple <em>a posteriori</em>. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>The table's name </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_table_8java_source.html#l00075">75</a> of file <a class="el" href="_table_8java_source.html">Table.java</a>.</p>

</div>
</div>
<a class="anchor" id="a226e2304771b71716a8961a4a0a8446e"></a><!-- doxytag: member="ca::uqac::dim::turtledb::Table::setSchema" ref="a226e2304771b71716a8961a4a0a8446e" args="(Schema sch)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a226e2304771b71716a8961a4a0a8446e">ca.uqac.dim.turtledb.Table.setSchema</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_schema.html">Schema</a>&#160;</td>
          <td class="paramname"><em>sch</em></td><td>)</td>
          <td><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Sets the table's schema </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">sch</td><td>The schema </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="_table_8java_source.html#l00105">105</a> of file <a class="el" href="_table_8java_source.html">Table.java</a>.</p>

</div>
</div>
<a class="anchor" id="a8616d5a42e073876c16bdb41bd17baa5"></a><!-- doxytag: member="ca::uqac::dim::turtledb::Table::streamIterator" ref="a8616d5a42e073876c16bdb41bd17baa5" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_relation_stream_iterator.html">RelationStreamIterator</a> <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a8616d5a42e073876c16bdb41bd17baa5">ca.uqac.dim.turtledb.Table.streamIterator</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns an iterator over tuples of the relation </p>
<dl class="return"><dt><b>Returns:</b></dt><dd></dd></dl>

<p>Implements <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_relation.html#ae5ed6d099a1c47cc0aa0026f9b5a4431">ca.uqac.dim.turtledb.Relation</a>.</p>

<p>Definition at line <a class="el" href="_table_8java_source.html#l00216">216</a> of file <a class="el" href="_table_8java_source.html">Table.java</a>.</p>

</div>
</div>
<a class="anchor" id="a615684670db2aebde7f60439f4dd4176"></a><!-- doxytag: member="ca::uqac::dim::turtledb::Table::tupleCount" ref="a615684670db2aebde7f60439f4dd4176" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a615684670db2aebde7f60439f4dd4176">ca.uqac.dim.turtledb.Table.tupleCount</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the number of actual tuples present in the query. This number is different from the cardinality of the query; it counts the number of tuples that are present in the leaves of the query tree. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>The tuple count </dd></dl>

<p>Implements <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_relation.html#aa39696dd8f39129e2c02e1323c01b124">ca.uqac.dim.turtledb.Relation</a>.</p>

<p>Definition at line <a class="el" href="_table_8java_source.html#l00204">204</a> of file <a class="el" href="_table_8java_source.html">Table.java</a>.</p>

</div>
</div>
<a class="anchor" id="a19846d1f280e9a8658a751b5b6e23bf6"></a><!-- doxytag: member="ca::uqac::dim::turtledb::Table::tupleIterator" ref="a19846d1f280e9a8658a751b5b6e23bf6" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Iterator&lt;<a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_tuple.html">Tuple</a>&gt; <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a19846d1f280e9a8658a751b5b6e23bf6">ca.uqac.dim.turtledb.Table.tupleIterator</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_table_8java_source.html#l00245">245</a> of file <a class="el" href="_table_8java_source.html">Table.java</a>.</p>

</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="aca90042d676729668163a64a9c075d90"></a><!-- doxytag: member="ca::uqac::dim::turtledb::Table::m_cursor" ref="aca90042d676729668163a64a9c075d90" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#aca90042d676729668163a64a9c075d90">ca.uqac.dim.turtledb.Table.m_cursor</a><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_table_8java_source.html#l00039">39</a> of file <a class="el" href="_table_8java_source.html">Table.java</a>.</p>

</div>
</div>
<a class="anchor" id="a7ad2aa40cdd0507967204075cdeac3ad"></a><!-- doxytag: member="ca::uqac::dim::turtledb::Table::m_name" ref="a7ad2aa40cdd0507967204075cdeac3ad" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">String <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a7ad2aa40cdd0507967204075cdeac3ad">ca.uqac.dim.turtledb.Table.m_name</a><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_table_8java_source.html#l00040">40</a> of file <a class="el" href="_table_8java_source.html">Table.java</a>.</p>

</div>
</div>
<a class="anchor" id="a80c04212069dd7548effe8acbf0a2b9d"></a><!-- doxytag: member="ca::uqac::dim::turtledb::Table::m_schema" ref="a80c04212069dd7548effe8acbf0a2b9d" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_schema.html">Schema</a> <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a80c04212069dd7548effe8acbf0a2b9d">ca.uqac.dim.turtledb.Table.m_schema</a><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_table_8java_source.html#l00038">38</a> of file <a class="el" href="_table_8java_source.html">Table.java</a>.</p>

</div>
</div>
<a class="anchor" id="a8d7fc7bc7d659babddbee9c10f6d3130"></a><!-- doxytag: member="ca::uqac::dim::turtledb::Table::m_tuples" ref="a8d7fc7bc7d659babddbee9c10f6d3130" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">List&lt;<a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_tuple.html">Tuple</a>&gt; <a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html#a8d7fc7bc7d659babddbee9c10f6d3130">ca.uqac.dim.turtledb.Table.m_tuples</a><code> [protected]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_table_8java_source.html#l00037">37</a> of file <a class="el" href="_table_8java_source.html">Table.java</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>src/ca/uqac/dim/turtledb/<a class="el" href="_table_8java_source.html">Table.java</a></li>
</ul>
</div><!-- contents -->
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="namespaceca.html">ca</a>      </li>
      <li class="navelem"><a class="el" href="namespaceca_1_1uqac.html">uqac</a>      </li>
      <li class="navelem"><a class="el" href="namespaceca_1_1uqac_1_1dim.html">dim</a>      </li>
      <li class="navelem"><a class="el" href="namespaceca_1_1uqac_1_1dim_1_1turtledb.html">turtledb</a>      </li>
      <li class="navelem"><a class="el" href="classca_1_1uqac_1_1dim_1_1turtledb_1_1_table.html">Table</a>      </li>

    <li class="footer">Generated on Fri Dec 7 2012 18:55:40 for TurtleDB by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>
   </ul>
 </div>


</body>
</html>
